package com.richman.hg;

import com.richman.controller.DecreseRatio;
import com.richman.utils.Common;

public class HGGrabThread extends Thread {

	public long sleepTime = 30*1000;
	HGManager hgmanager = null;
	
	
	boolean start = false;
	boolean loginNow = false;
	
	
	boolean bexit = false;
	
	public boolean getbexit() {
		return bexit;
	}

	public HGGrabThread(){		
		hgmanager = new HGManager();
		hgmanager.init();
		
	}
	
	
	@Override
    public void run() {

		try{

			while(DecreseRatio.bStartEngine){
				try{
					
					

					hgmanager.login();
					hgmanager.grabEvents();
					//todo 睡眠时间减少
					//Thread.sleep(3000);
					
				}catch(Exception e){
					e.printStackTrace();
					Thread.sleep(2000);
				}
				

			}
			

			HGManager.HGEvents.clear();
			
			//DaShui.mainWnd.updateISNEventsTable(HGManager.HGEvents);
			
			bexit = true;

		}catch(Exception e){
			e.printStackTrace();
		}	
	}
	
}
